import java.util.Random;

/*
* 3、B；4、A；5、D------B*/
public class Test {
    public static int GetAge(int Person){//获得第person的人的年龄
        if (Person == 1){
            return 10;
        }
        int age = GetAge(Person - 1) + 2;
        return age;
    }

    public static void main1(String[] args) {
        int z = GetAge(5);
        System.out.println(z);
    }
    public static void main(String[] args) {
        Random random = new Random();
        int[][] array = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                array[i][j] = random.nextInt(9);
            }
        }
        int sum1 = 0;
        int sum2 = 0;
        for (int i = 0; i < array.length; i++) {
            for (int j = 0; j < array[i].length; j++) {
//1、确定左到右的对角线
                if(i == j) {
                    sum1 += array[i][j];
                }
//2、确定右到左的对角线
                if(i+j == array.length-1) {
                    sum2 += array[i][j];
                }
            }
        }
        System.out.println(sum1);
        System.out.println(sum2);
    }

}
